/**

 * @author *琴
 * @mailbox 1570149578@qq.com
 * @company  四川英瑞世博电子商务有限公司
 * @date 2020-06-08 14:49
 * @http  https://********

 */

import { globalData } from '../config/globalData'
import baseUrl from '../baseUrl'
import api from '../config/api'
import ajax from '../utils/ajax'

export default class Notice {
  /**
   * 公告列表
   *param
   */
  static async getNoticeList (param = {}) {
    let defParam = {
      token: globalData.access_token
    }
    param = Object.assign(defParam, param)
    let url = baseUrl.server + api.NOTICE_LIST
    let res = await ajax.get(url, param)
    return res
  }

  /**
   * 公告详情
   *param
   */
  static async getNoticeDetail (param = {}) {
    let defParam = {
      token: globalData.access_token
    }
    param = Object.assign(defParam, param)
    let url = baseUrl.server + api.NOTICE_DETAIL
    let res = await ajax.get(url, param)
    return res
  }

  /**
   * 公告访问量
   *param
   */
  static async getNoticeVisits (param = {}) {
    let defParam = {
      token: globalData.access_token
    }
    param = Object.assign(defParam, param)
    let url = baseUrl.server + api.NOTICE_VISITS
    let res = await ajax.get(url, param)
    return res
  }
}
